﻿#include "widget.h"
#include "ui_widget.h"
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    // 获取当前值
    connect(ui->btn_getvalue,&QPushButton::clicked,[=](){
        qDebug()<<"cur num="<<ui->widget->getNum();
    });

    // 设置当前值为50
    connect(ui->btn_sethalfvalue,&QPushButton::clicked,[=](){
        ui->widget->setNum(50);
    });

}

Widget::~Widget()
{
    delete ui;
}


